package com.wander.patterns.create.factory.simplefactory;

import com.wander.patterns.create.factory.factorymethod.AudiCar;
import com.wander.patterns.create.factory.factorymethod.BydCar;
import com.wander.patterns.create.factory.factorymethod.ICar;

/**
 * @description:
 * @author: zhuyong
 * @create: 2019-09-04 17:54
 **/
public class CarFactory {
    public static ICar produce(String name){
        if(name == "奥迪"){
            return new AudiCar();
        }else if(name == "比亚迪"){
            return new BydCar();
        }else{
            return null;
        }
    }
}
